﻿//-----------------------------------------------------------------------
// <copyright file="multilinetexteditorfielddefinition.cs" company="Jamie Knight">
// Copyright (c) Jamie Knight. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
using System.Windows.Data;
using DevKnightlie.WPF.AutoForm.FieldDefinitions;
using Xceed.Wpf.Toolkit;

namespace DevKnightlie.WPF.AutoForm.WPFToolkit.FieldDefinitions
{
    /// <summary>
    /// Field definition which creates a MultiLineTextEditor control
    /// </summary>
    public class MultiLineTextEditorFieldDefinition:BaseFieldDefinition
    {
        #region Methods

        public override void BuildInputControl()
        {
            MultiLineTextEditor textBox = new MultiLineTextEditor();
            Binding textBinding = new Binding(PropertyName);
            BindingOperations.SetBinding(textBox, MultiLineTextEditor.TextProperty, textBinding);
            SetupEnabledBinding(textBox);
            InputControl = ContainerControl = textBox;
        }

        #endregion
    }
}
